<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

    //     // 构造函数
    //    let Person = function(name,age){
    //        this.name = name;
    //        this.age = age;
    //    };

    //    //可以用new来调用生成实例化对象
    //    let p1 = new Person("老王",18);


    //    console.log(p1);


        // 箭头函数不能实现构造函数
         let Person = (name,age)=>{
             this.name = name;
             this.age = age;
         };

        //  console.log(Person.__proto__); //ƒ () { [native code] }

        //  console.log(Person.prototype); //undefined

        //  Person is not a constructor  函数不是一个构造器
        //  let p1 = new Person("老李",30); 


        //  console.log(p1);








    </script>
</body>
</html>